// 商品管理
import request from '@/utils/request';
//添加商品
export const goodsAddcate = (data) => {
  return request({
    url: 'goods/addcate',
    method: 'post',
    data
  })
}
//获取商品的分类
export const goodsCatelist = (params) => {
  return request({
    url: 'goods/catelist',
    method: 'get',
    params
  })
}
//删除商品
export const goodsDelcate = (params) => {
  return request({
    url: "goods/delcate",
    method: 'get',
    params
  })
}
//修改分类
export const goodsEditcate = (data) => {
  return request({
    url: 'goods/editcate',
    method: 'post',
    data
  })
}
//查询所有分类名称
export const goodsCategories = () => {
  return request({
    url: 'goods/categories',
    method: 'get'
  })
}
// 商品图片上传接口
export const goodsImgUpload = (data) => {
  return request({
    ulr: 'goods/goods_img_upload',
    method: 'post',
    data
  })
}
//添加商品
export const goodsAdd = (data) => {
  return request({
    url: 'goods/add',
    method: 'post',
    data
  })
}
// goods/list
//获取商品列表
export const goodsList = (params) => {
  return request({
    url: 'goods/list',
    method: 'get',
    params
  })
}
//修改商品
// goods/edit
export const goodsEdit = (data) => {
  return request({
    url: 'goods/edit',
    method: 'post',
    data
  })
}
//商品删除
export const goodsDel = (params) => {
  return request({
    url: 'goods/del',
    method: 'get',
    params
  })
}